import type { RouteRecordRaw } from 'vue-router'
import HomePage from '@/pages/HomePage.vue'
import UserLoginPage from '@/pages/user/UserLoginPage.vue'
import UserRegisterPage from '@/pages/user/UserRegisterPage.vue'
import UserManagePage from '@/pages/admin/UserManagePage.vue'
import SHOW_ENUM from '@/enums/showEnum.ts'
import ACCESS_ENUM from '@/enums/accessEnum.ts'
import { HomeOutlined, UserOutlined, FileOutlined, RadarChartOutlined, AlertOutlined } from '@ant-design/icons-vue'
import UserCenterPage from '@/pages/user/UserCenterPage.vue'
import FileManagePage from '@/pages/admin/FileManagePage.vue'
import AddFilePage from '@/pages/AddFilePage.vue'
import FileDetailPage from '@/pages/FileDetailPage.vue'
import AddFileTrainPage from '@/pages/AddFileTrainPage.vue'
import TrainManagePage from '@/pages/admin/TrainManagePage.vue'
import TrainDetailPage from '@/pages/TrainDetailPage.vue'
import PatientManagePage from '@/pages/admin/PatientManagePage.vue'

export const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: '主页',
    component: HomePage,
    meta: {
      show: SHOW_ENUM.HEAD_SHOW,
      icon: HomeOutlined,
    },
  },
  {
    path: '/user/login',
    name: '用户登录',
    component: UserLoginPage,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: '/user/register',
    name: '用户注册',
    component: UserRegisterPage,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: '/user/center',
    name: '用户中心',
    component: UserCenterPage,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: '/admin/userManage',
    name: '用户管理',
    component: UserManagePage,
    meta: {
      show: SHOW_ENUM.HEAD_SHOW,
      access: ACCESS_ENUM.ADMIN,
      icon: UserOutlined,
    },
  },
  {
    path: '/admin/fileManage',
    name: '文件管理',
    component: FileManagePage,
    meta: {
      show: SHOW_ENUM.HEAD_SHOW,
      access: ACCESS_ENUM.ADMIN,
      icon: FileOutlined,
    },
  },
  {
    path: '/admin/trainManage',
    name: '模型管理',
    component: TrainManagePage,
    meta: {
      show: SHOW_ENUM.HEAD_SHOW,
      access: ACCESS_ENUM.ADMIN,
      icon: RadarChartOutlined,
    },
  },
  {
    path: '/user/patientManage',
    name: '病人管理',
    component: PatientManagePage,
    meta: {
      show: SHOW_ENUM.HEAD_SHOW,
      icon: AlertOutlined,
    },
  },
  {
    path: '/add_file',
    name: '创建图片',
    component: AddFilePage,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: '/file/:id',
    name: '文件详情',
    component: FileDetailPage,
    props: true,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: '/add_train',
    name: '添加训练',
    component: AddFileTrainPage,
    props: true,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: '/train/:id',
    name: '模型详情',
    component: TrainDetailPage,
    props: true,
    meta: {
      hideInMenu: true,
    },
  },
]
